import React, { useState } from 'react'

export default function App() {
  const [age,setAge] = useState(18)
  const [money,setMoney] = useState(1000)
  const [star,setStar] = useState(['迪丽热巴','古力娜扎','安其拉巴巴'])
  return (
    <div>
      <h1>张三同学，今年{age}岁</h1>
      <p>他的存款：{money}</p>
      <ul>
        {
          star.map((item,index)=> <li key={index}>{item}</li>)
        }
      </ul>
      <button onClick={()=>setAge(age+1)}>更改年龄+1</button>
      <button onClick={()=>setMoney(money+100)}>修改存款+100</button>
      <button onClick={()=>setStar([...star,'老登'])}>添加列表元素</button>
    </div>
  )
}
